import { IFeidaoAiNodejsComponent } from '@feidao/web/interfaces';

import P01 from './P01';
import P06 from './P06';
import P07 from './P07';

import nodejs from '@feidao/web/atom/nodejs/msg-b/nodejs';
import render from '@feidao/web/atom/nodejs/render/render';

export default async function nba001(fd: IFeidaoAiNodejsComponent, ...args: any[]) {
	// 组件初始化

	// 院部
	const res = await nodejs(fd.data.spaceid, "school_department_find", {});
	render(fd.data.node, res, P01, 'P01');

	// 考试，默认
	const exam_data = await nodejs(fd.data.spaceid, "exam_find", { criteria: { "default_val": "是" }, page_no: 1, page_size: 1 });
	if (exam_data.count != 0) {
		render(fd.data.node, exam_data.dataArray[0], P06, 'P06');
	}

	// 空数据
	// render(fd.data.node, '', P07, 'P07');
}
